
import React from 'react';
import {Link, Route} from "../react-router-dom";
import UserAdd from "./UserAdd";
import UserList from "./UserList";
import UserDetail from "./UserDetail";

class User extends React.Component {
  constructor(props) {
    super(props);
    this.state = {  }
  }
  render() { 
    return ( 
      <div style={{
          display: "flex",
      }}>
          <nav>
              <li><Link to={"/user/add"}>添加用户</Link></li>
              <li><Link to={"/user/list"}>用户列表</Link></li>
          </nav>
          <div style={{
              flexShrink: 0
          }}>
              <Route path={"/user/add"} component={UserAdd} />
              <Route path={"/user/list"} component={UserList} />
              <Route path={"/user/detail/:id"} exact={true} component={UserDetail} />
          </div>
      </div>
     );
  }
}
 
export default User;